#ifndef DH_DATA_H
#define DH_DATA_H

#include <QtCore>

//除湿设备DeHumidification
class CDhData
{
public:
    bool IsCommNormal();
    bool IsCommFault();

    bool IsRunning();
    bool IsStopped();

    bool IsFault();
    bool IsNoFault();

    bool IsAlarm();
    bool IsNoAlarm();

    bool IsOpening();
    bool IsClosed();

    //获取***的显示文本
    QString GetCommStateText();

    void InitToInvalid();
    void InitToZero();
    void InitToValue(quint16 uvalue, float fvalue);

public:
    quint16 m_uCommState;           //4801 通讯状态 0--正常,1-故障
    quint16 m_uRev[99];
    float m_fRev[100];

    //转发的100个UINT16数据
    quint16 m_uRunState;            //4802 运行状态 0运行,1停止
    quint16 m_uFaultState;          //4803 故障状态 0正常,1故障
    quint16 m_uAlarmState;          //4804 告警状态 0正常,1告警
    quint16 m_uSwitchState;         //4805 开关机状态 0已开机,1已关机
    quint16 m_uCtrlTempType;        //控温方式

    quint16 m_uCtrlHumiType;        //控湿方式
    quint16 m_uCtrlTempManualSwitch; //控温手动开关
    quint16 m_uCtrlHumiManualSwitch; //控湿手动开关

    quint16 m_uData[92];            //4806~5000 转发的UINT16数据:预留,数组数量=100-上面的转发数

    //转发的100个FLOAT数据
    float m_fInsideTemp;            //5001 室内温度℃
    float m_fInsideHumi;            //5003 室内湿度%
    float m_fOutsideTemp;           //5005 室外温度℃
    float m_fOutsideHumi;           //5007 室外湿度%
    float m_fCtrlTempStartValue;    //控温开启值

    float m_fCtrlTempStopValue;     //控温停止值
    float m_fCtrlTempDiffValue;     //控温回差值
    float m_fCtrlHumiStartValue;    //控湿开启值
    float m_fCtrlHumiStopValue;     //控湿停止值
    float m_fCtrlHumiDiffValue;     //控湿回差值

    float m_fTempAlarmUpLimit;      //温度报警上限值
    float m_fTempAlarmDownLimit;    //温度报警下限值
    float m_fPointTempStartValue;   //露点温度启动值
    float m_fPointTempStopValue;    //露点温度停止值
    float m_fPointTempDiffValue;    //露点温度回差值

    float m_fHeaterStartTemp;       //加热器启动温度
    float m_fHeaterStopTemp;        //加热器停止温度
    float m_fHeaterDiffTemp;        //加热器回差温度
    float m_fDryerStartHumi;        //除湿器启动湿度
    float m_fDryerStopHumi;         //除湿器停止湿度

    float m_fDryerDiffHumi;         //除湿器回差湿度
    float m_fFanStartTemp;          //排风启动温度
    float m_fFanStopTemp;           //排风停止温度
    float m_fFanDiffTemp;           //排风回差温度
    float m_fMonitorMaxTemp;        //监控下发最大温度,单位为℃

    float m_fMonitorMinTemp;        //监控下发最小温度,单位为℃
    float m_fMonitorAvgTemp;        //监控下发平均温度,单位为℃
    float m_fVolAlarmUpLimit;       //电压告警高限,单位为V
    float m_fVolAlarmDownLimit;     //电压告警低限,单位为V

    float m_fData[71];              //5009~5399 转发的FLOAT数据:预留,数组数量=100-上面的转发数

    // 4801     5000	200	UINT16	200	读除湿的UNIT16数据	0x03/0x04	无	除湿数据
    // 5001     5400	400	FLOAT	200	读除湿的FLOAT数据	0x03/0x04	无
    // 21601	21800	200	UINT16	200	写除湿的数据	0x03/0x04	0x06

    float m_fSetTempStart;          //21601 设置开始温度/目标温度
    float m_fSetTempStartCopy;
    float m_fSetTempStop;           //21602 设置结束温度
    float m_fSetTempStopCopy;
    float m_fSetTempDiff;           //21603 设置温度回差
    float m_fSetTempDiffCopy;
    float m_fSetHumiStart;          //21604 设置开始湿度/目标湿度
    float m_fSetHumiStartCopy;
    float m_fSetHumiStop;           //21605 设置结束湿度
    float m_fSetHumiStopCopy;

    float m_fSetHumiDiff;           //21606 设置湿度回差
    float m_fSetHumiDiffCopy;
    float m_fSetCtrlTempStartValue;    //控温开启值
    float m_fSetCtrlTempStartValueCopy;
    float m_fSetCtrlTempStopValue;     //控温停止值
    float m_fSetCtrlTempStopValueCopy;
    float m_fSetCtrlTempDiffValue;     //控温回差值
    float m_fSetCtrlTempDiffValueCopy;
    float m_fSetCtrlHumiStartValue;    //控湿开启值
    float m_fSetCtrlHumiStartValueCopy;

    float m_fSetCtrlHumiStopValue;     //控湿停止值
    float m_fSetCtrlHumiStopValueCopy;
    float m_fSetCtrlHumiDiffValue;     //控湿回差值
    float m_fSetCtrlHumiDiffValueCopy;
    float m_fSetTempAlarmUpLimit;      //温度报警上限值
    float m_fSetTempAlarmUpLimitCopy;
    float m_fSetTempAlarmDownLimit;    //温度报警下限值
    float m_fSetTempAlarmDownLimitCopy;
    float m_fSetPointTempStartValue;   //露点温度启动值
    float m_fSetPointTempStartValueCopy;

    float m_fSetPointTempStopValue;    //露点温度停止值
    float m_fSetPointTempStopValueCopy;
    float m_fSetPointTempDiffValue;    //露点温度回差值
    float m_fSetPointTempDiffValueCopy;
    float m_fSetHeaterStartTemp;       //加热器启动温度
    float m_fSetHeaterStartTempCopy;
    float m_fSetHeaterStopTemp;        //加热器停止温度
    float m_fSetHeaterStopTempCopy;
    float m_fSetHeaterDiffTemp;        //加热器回差温度
    float m_fSetHeaterDiffTempCopy;

    float m_fSetDryerStartHumi;        //除湿器启动湿度
    float m_fSetDryerStartHumiCopy;
    float m_fSetDryerStopHumi;         //除湿器停止湿度
    float m_fSetDryerStopHumiCopy;
    float m_fSetDryerDiffHumi;         //除湿器回差湿度
    float m_fSetDryerDiffHumiCopy;
    float m_fSetFanStartTemp;          //排风启动温度
    float m_fSetFanStartTempCopy;
    float m_fSetFanStopTemp;           //排风停止温度
    float m_fSetFanStopTempCopy;

    float m_fSetFanDiffTemp;           //排风回差温度
    float m_fSetFanDiffTempCopy;
    float m_fSetMonitorMaxTemp;         //监控下发最大温度,单位为℃
    float m_fSetMonitorMaxTempCopy;
    float m_fSetMonitorMinTemp;         //监控下发最小温度,单位为℃
    float m_fSetMonitorMinTempCopy;
    float m_fSetMonitorAvgTemp;          //监控下发平均温度,单位为℃
    float m_fSetMonitorAvgTempCopy;
    float m_fSetVolAlarmUpLimit;       //电压告警高限,单位为V
    float m_fSetVolAlarmUpLimitCopy;

    float m_fSetVolAlarmDownLimit;     //电压告警低限,单位为V
    float m_fSetVolAlarmDownLimitCopy;

    //21607~21800 设置的数据:预留,数组数量=100-上面的设置数
    float m_fSetData[69];
    float m_fSetDataCopy[69];
    //上面100个浮点设置值
    //下面100个整形设置值
    quint16 m_uSetSwitch;               //下设开关机:0关机,1开机
    quint16 m_uSetSwitchCopy;
    quint16 m_uSetRemoteState;          //下设远程状态:0本地,1远程
    quint16 m_uSetRemoteStateCopy;
    quint16 m_uSetRemoteEnable;         //下设远程使能:0禁用/未启用;1未禁用/启用
    quint16 m_uSetRemoteEnableCopy;
    quint16 m_uSetFaultReset;           //设置故障复位:0不动作,1故障复位
    quint16 m_uSetFaultResetCopy;
    quint16 m_uSetSlientMode;           //设置静音模式
    quint16 m_uSetSlientModeCopy;

    quint16 m_uSetCtrlTempType;        //设置控温方式
    quint16 m_uSetCtrlTempTypeCopy;
    quint16 m_uSetCtrlHumiType;        //设置控湿方式
    quint16 m_uSetCtrlHumiTypeCopy;
    quint16 m_uSetCtrlTempManualSwitch; //设置控温手动开关
    quint16 m_uSetCtrlTempManualSwitchCopy;
    quint16 m_uSetCtrlHumiManualSwitch; //设置控湿手动开关
    quint16 m_uSetCtrlHumiManualSwitchCopy;

    quint16 m_uSetData[91];
    quint16 m_uSetDataCopy[91];
};

#endif //DH_DATA_H
